/**
 * Copyright [2012-2013] [Guðmundur Björn Birkisson]
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *     http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License. Copyright [2012-2013] [Guðmundur Björn Birkisson]
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *     http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * 
 * ---------------------------------------------------------------------------
 * 
 * Class name:  GameContainer
 * 
 * Description of class:
 * 
 * Contains the Map and Robot.
 * 
 */

package karel.gamelogic;

import java.io.Serializable;
import karel.gamelogic.world.Direction;
import karel.gamelogic.world.KarelMap;
import karel.gamelogic.world.KarelRobot;
import karel.util.ClassCopier;


public class GameContainer implements Serializable {
    
    public static Direction.DirName defaultDirection = Direction.DirName.SOUTH;
    public static final float maxAnimationSpeed = 120.0f;
    public static float gameAnimationSpeed = 1.0f;
    
    public KarelMap map;
    public KarelRobot robot;
    
    private KarelRobot originalRobot;
    private KarelMap originalMap;

    public GameContainer(KarelMap map, KarelRobot robot) {
        this.map = map;
        this.robot = robot;
        
        originalRobot = new KarelRobot(robot);
        originalMap = (KarelMap)ClassCopier.copyClass(map);
    }

    void resetGameContainer() {
        robot = new KarelRobot(originalRobot);
        map = (KarelMap)ClassCopier.copyClass(originalMap);
    }
}
